home *** CD-ROM | disk | FTP | other *** search
/ Suzy B Software 2 / Suzy B Software CD-ROM 2 (1994).iso / new_file / games / csb_port / csb_port.lst < prev   
File List  |  1995-04-25  |  2KB  |  84 lines

  1. REM ***************************************************************
  2. REM *                                                             *
  3. REM *    Public Domain Chaos Strikes Back portrait loader.        *
  4. REM *                                                             *
  5. REM *           by Devin Balkcom                                  *
  6. REM *           Created with GFA Basic 3.5e                       *
  7. REM *                                                             *
  8. REM *       --> Insert CSB Utility disk before proceeding!        *
  9. REM *                                                             *
  10. REM ***************************************************************
  11. '
  12. @get_palette(old_palette$)      ! Get old palette
  13. @dm_palette                     ! Set to Dungeon Master palette
  14. '
  15. DIR "a:\portrait\" TO "d:\temp.lst"           ! This is a buffer
  16. DIM character$(1000)                          ! d:\temp.lst could
  17. OPEN "I",#1,"d:\temp.lst"                     ! be any file.
  18. i=0
  19. REPEAT
  20.   INC i
  21.   INPUT #1,character$(i)
  22.   @load_portrait(character$(i))
  23.   BOX 0,0,33,30
  24.   PUT 1,1,portrait$
  25.   LOCATE 1,16
  26.   PRINT nickname$+SPACE$(8)
  27.   PRINT title$+SPACE$(20)
  28.   a=INP(2)
  29. UNTIL EOF(#1)
  30. CLOSE #1
  31. '
  32. KILL "d:\temp.lst"                            ! Get rid of buffer
  33. @set_palette(old_palette$)                    ! Restore palette
  34. '
  35. > PROCEDURE load_portrait(name$)
  36.   OPEN "I",#99,"a:\portrait\"+name$
  37.   SEEK #99,16
  38.   nickname$=INPUT$(8,#99)
  39.   title$=INPUT$(20,#99)
  40.   SEEK #99,44
  41.   portrait$=INPUT$(464,#99)
  42.   portrait2$=SPACE$(470)
  43.   DPOKE V:portrait2$,31
  44.   DPOKE V:portrait2$+2,28
  45.   DPOKE V:portrait2$+4,4
  46.   BMOVE V:portrait$,V:portrait2$+6,464
  47.   portrait$=portrait2$
  48.   CLOSE #99
  49. RETURN
  50. > PROCEDURE dm_palette
  51.   RESTORE palette
  52.   FOR i=0 TO 15
  53.     READ r,g,b
  54.     SETCOLOR i,r,g,b
  55.     DEFFILL i,1,1
  56.   NEXT i
  57. palette:
  58.   DATA 0,0,0
  59.   DATA 3,3,3
  60.   DATA 4,4,4
  61.   DATA 3,1,0
  62.   DATA 0,6,6
  63.   DATA 4,2,0
  64.   DATA 0,4,0
  65.   DATA 0,6,0
  66.   DATA 7,0,0
  67.   DATA 7,5,0
  68.   DATA 6,4,3
  69.   DATA 7,7,0
  70.   DATA 2,2,2
  71.   DATA 5,5,5
  72.   DATA 0,0,7
  73.   DATA 7,7,7
  74. RETURN
  75. > PROCEDURE get_pallette(VAR palette$)
  76.   palette$=""
  77.   FOR i=0 TO 15
  78.     palette$=palette$+MKI$(XBIOS(7,i,-1))
  79.   NEXT i
  80. RETURN
  81. > PROCEDURE set_palette(palette$)
  82.   ~XBIOS(6,L:V:palette$)
  83. RETURN
  84.